import React from 'react';
import {
    SafeAreaView,
    StyleSheet,
    ScrollView,
    View,
    Text,
    StatusBar,
} from 'react-native';
import {Primeton, PageComponent} from "primeton-mobile";

export default class SecondPage extends PageComponent {

    //不显示微应用标题栏
    showTitleComponent = false

    constructor(props) {
        super(props)
        this.pamameter = this.getParameter();
    }
    
    onAndroidBackPressed() {
        this.pageGoBack({data:'安卓物理返回键返回的值'})
        return true;
    }

    render() {
        const {navigation} = this.props
        return (<View style={styles.container}>
            <Text style={styles.title}>第二页</Text>
            <Text>{'来自上个页面参数  ' + this.pamameter.name}</Text>
            <Text style={styles.btn} onPress={() => {
                this.pageGoBack({data:'我来第二个页面返回的值1'})
            }}>返回</Text>
        </View>)
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center'
    },
    title: {
        fontSize: 24,
        fontWeight: 'bold',
        color: '#845532'
    },
    btn: {
        fontSize: 20,
        margin: 15,
        fontWeight: 'bold'
    }
})
